package com.example.springdatajpa.service;

import com.example.springdatajpa.dao.CustomerDao;
import com.example.springdatajpa.entity.Customer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author wangning
 * @create 2021-03-07 16:59
 * @description
 */
@Service
public class CustomerServiceImpl implements CustomerService {
	@Autowired
	private CustomerDao customerDao;


	@Override
	public List<Customer> findAll() {
		return customerDao.findAll();
	}

	@Override
	@Transactional
	public int updateCustomer(String custName, Long custId) {
		return customerDao.updateCustomer("oooooooo", 19L);
	}

}
